#ifndef DEVICECAPS_H
#define DEVICECAPS_H

#include "CommonTypes.h"

namespace Cvekas {

// TODO: provide easy info about fp texture blending and fp rendertarget multisampling, also instancing
	
/// \brief Video device capabilities
///
/// \remarks There is no public constructor, so the only way to get instance is by calling VideoDevice::getCaps(D3DDEVTYPE), 
/// note that you can do this without initializing device, all you need is an instance of VideoDevice
class DeviceCaps
{
public:
	/// Pixel shader versions
	enum PShaderVersion
	{
		no_ps = 0,
		ps1_1,
		ps1_4,
		ps2_0,
		ps3_0
	};
	/// Vertex shader versions
	enum VShaderVersion
	{
		no_vs = 0,
		vs1_1,
		vs2_0,
		vs3_0
	};

	/// Returns D3DCAPS9 structure for accessing information that isn't provided by DeviceCaps
	const D3DCAPS9& getD3DCaps();
	/// Returns D3DDEVTYPE of device
	D3DDEVTYPE getDeviceType();

	/// Returns pixel shader version
	PShaderVersion getPSVersion();
	/// Returns vertex shader version
	VShaderVersion getVSVersion();
	/// Returns multiple render target count
	uint getMRTCount();
	/// Is floating point (D3DFMT_R32F and D3DFMT_A16B16G16R16F) rendertargets supported?
	bool supportFloatRT();

private:
	DeviceCaps(D3DPtr d3d, D3DDEVTYPE device_type);
	
	D3DCAPS9 caps;
	D3DDEVTYPE device_type;

	PShaderVersion ps_version;
	VShaderVersion vs_version;
	int mrt_count;
	bool fp_rt_support;

	D3DPtr d3d;

	friend class VideoDevice;
};

typedef boost::shared_ptr<DeviceCaps> DeviceCapsPtr;

} // namespace

#endif